<?php
use Yjius\common\Debug;

require __DIR__ . "/../../vendor/autoload.php";

try {

    //等比例缩小
    $file = 'D:\\htdocs\\test\\Yjius\\examples\\runtime\\tmp\\logo.png';   //待加水印的图片地址
    $res = \Yjius\common\ImageHelper::cutout($file,0,0,125,60);;
    echo $res;exit;

    //等比例缩小
    $file = 'D:\\htdocs\\test\\Yjius\\examples\\runtime\\tmp\\logo.png';   //待加水印的图片地址
    $res = \Yjius\common\ImageHelper::compress($file,80);
    echo $res;exit;


    //水印
    $file = 'D:\\htdocs\\test\\Yjius\\examples\\runtime\\tmp\\logo.png';   //待加水印的图片地址
    $water = 'D:\\htdocs\\test\\Yjius\\examples\\runtime\\tmp\\back.png';  //水印图片的地址
    $res = \Yjius\common\ImageHelper::watermark($file, $water);
    echo $res;exit;

    //首字母头像
    $res = \Yjius\common\ImageHelper::letterAvatar('李白');
    echo $res;exit;

    //图片验证码
    $res = \Yjius\common\ImageHelper::verifyCode('dddd');
    echo $res;exit;

    Debug::print_r($res1);
} catch (Exception $exception) {
    echo $exception->getMessage();
    exit;
}